﻿using Day27Auth.Filters;
using Day27Auth.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Day27Auth.Controllers
{
    public class AngularJSController : Controller
    {

        [ExternalJavaScriptFile]
        public ActionResult Routes()
        {
            AngularRouteConfigViewModel model = new AngularRouteConfigViewModel();

            model.Routes = new List<AngularRouteViewModel>
            {
                new AngularRouteViewModel
                {
                    Controller = "HomeController",
                    Path = "/",
                    TemplateUrl = "/app/views/HomeView.html",
                    UseCtrlAlias = true
                },
                new AngularRouteViewModel
                {
                    Controller = "TodoController",
                    Path = "/todo",
                    TemplateUrl = "/app/views/TodoView.html",
                    UseCtrlAlias = true
                },
                new AngularRouteViewModel
                {
                    Controller = "AdminController",
                    Path = "/admin",
                    TemplateUrl = "/app/views/AdminView.html"
                },
                new AngularRouteViewModel
                {
                    Controller = "LogoutController",
                    Path = "/logout",
                    TemplateUrl = "/app/views/LogoutView.html",
                    UseCtrlAlias = true
                }
            };


            return PartialView("_Routes", model);
        }
    }
}